<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>文本插值及指令</title>
  <style>
    .red{
        color: yellow;
    }
  </style>
</head>
<body>
  <div id="app">
    <!-- v-once-->
    计算器: <span v-once>{{counter}}</span><br>
    <!-- vm.counter = 300 -->

    <!-- v-html-->
    v-html: <span v-html="rawContent"></span><br>
    <!-- 注意 v-html 不对用户开放，容易收到 XSS 攻击-->

    <!-- v-bind-->
    <span v-bin:class="className">Vue3.x</span><br>


    <!-- v-if-->
    {{false? true: false}}
    {{'cdn.google.com'.split('.')}}
  </div>

  <script src="../vue.global.js"></script>
  <script>
    const App = {
      data(){
        return {
          counter: 100,
          rawContent: '<span style="color:red">是否解析 HTML</span>',
          className: 'yellowj',
        }
      }
    }

    const vm = Vue.createApp(App).mount('#app');
    console.log(vm)
  </script>
</body>
</html>
